<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>我的收藏</title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/pullToRefresh.css" />
		<link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/global.css" />
		<style type="text/css">
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
				color: #4c968e;
				background: transparent;
				border-bottom: none;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar {
				width: 50%;
				background-color: #4c968e;
			}
			
			.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item {
				border: none;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted {
				padding: 6px 0;
			}
			
			.mui-table-view:after {
				height: 0;
			}
		</style>
	</head>

	<body ng-app="detailsApp" ng-controller="detailsController">
		<header class="mui-bar mui-bar-nav bg_white">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title colorP">我的收藏</h1>
		</header>
		<div class="mui-content">
			<div class="mui-segmented-control mui-segmented-control-inverted bg_white">
				<a class="mui-control-item mui-active" href="#item1">动态</a>
				<a class="mui-control-item" href="#item2">商品</a>
			</div>
			<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-6"></div>
			<div id="item1" class="mui-slider-item mui-control-content mui-active">
				<p class="line-height44px padding_tb20 mui-text-center" ng-if="notes.length == 0"><i class="iconfont mui-icon font60">&#xe6e3;</i><br />还没有收藏内容</p>
				<ul class="mui-table-view bg_white" ng-repeat="(index,note) in notes">
					<li class="mui-table-view-cell mui-media" ng-repeat="(index,x) in note">
						<a href="javascript:;" class="mui-clearfix" ng-click="shequ(x.uid,0,x.id)">
							<div class="mui-media-object mui-pull-right margin_tb_8px">
								<img ng-if="x.file_type==0" ng-src="{{x.subject}}" style="width: 105px;height: 74px;">
								<img ng-if="x.file_type==1" ng-src="../img/video.png" style="background: #000;"/>
							</div>
							<ul class="mui-media-body mui-pull-left user_view">
								<li>
									<div class="user_pic"><img src="{{x.icon}}" /></div>
									<span class="padding_l">{{x.nick}}</span>
								</li>
								<li>
									<i class="iconfont mui-icon icon-color" ng-if="x.file_type == 0">&#xe615;</i>
									<i class="iconfont mui-icon icon-color" ng-if="x.file_type == 1">&#xe8b3;</i>
									<span class="padding_l">{{x.title}}</span>
								</li>
								<li>
									<i class="iconfont mui-icon icon-color">&#xe60a;</i>
									<span class="padding_l">{{x.tags}}</span>
								</li>
							</ul>
						</a>
					</li>
				</ul>
			</div>
			<div id="item2" class="mui-slider-item mui-control-content">
				<p class="line-height44px padding_tb20 mui-text-center" ng-if="goods.length == 0"><i class="iconfont mui-icon font60">&#xe6e3;</i><br />还没有收藏商品</p>
				<ul class="mui-table-view margin-bottom5px bg_white"ng-repeat="(index,good) in goods">
					<li class="mui-table-view-cell mui-media" ng-repeat="(index,vo) in good">
						<a href="javascript:;" ng-click="obtainId(vo.uid,vo.type,vo.id)">
							<img class="mui-media-object mui-pull-left goods_pic " ng-src="{{vo.good_image}}">
							<div class="mui-media-body">
								<div class="mui-ellipsis font16">{{vo.good_name}}</div>
								<div class="mui-clearfix"><span class="mui-pull-right colorP font14">工期：<i>{{vo.maf_time}}</i>天</span></div>
								<div class="mui-clearfix">
									<div class="mui-pull-left">
										<div class="user_pic"><img ng-src="{{vo.icon}}" /></div>
										<span class="padding_l line-height30px color999 font14">{{vo.nick}}</span>
									</div>
									<span class="mui-pull-right colorRed line-height30px">￥{{vo.price}}</span>
								</div>
							</div>
						</a>
					</li>
				</ul>
			</div>
			<p class="mui-text-center line-height44px" ng-if="not_more == 1">没有更多数据~~~</p>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/mui.pullToRefresh.js"></script>
	<script src="../js/mui.pullToRefresh.material.js"></script>
	<script src="../js/open.js"></script>
	<script src="../js/angular.min.js"></script>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/apppublic.js"></script>
	<script src="../js/app/my_collect.js"></script>
	<script type="text/javascript">
		$('.mui-segmented-control .mui-control-item').on('tap', function() {
			$('#sliderProgressBar').animate({ 'left': $(this).index() * $(this).innerWidth() + 'px' }, 'fast');
			$('.mui-control-content').eq($(this).index()).addClass('mui-active').siblings().removeClass('mui-active');
		})
	</script>
	<script type="text/javascript">
		(function($) {
			//阻尼系数
			var deceleration = mui.os.ios ? 0.003 : 0.0009;
			$('.mui-scroll-wrapper').scroll({
				bounce: false,
				indicators: false, //是否显示滚动条
				deceleration: deceleration
			});

			$.ready(function() {
				//循环初始化所有下拉刷新，上拉加载。
				$.each(document.querySelectorAll('.mui-content'), function(index, pullRefreshEl) {
					$(pullRefreshEl).pullToRefresh({
						down: {
							callback: function() {
								var self = this;
								setTimeout(function() {
									loadNews();
									self.endPullDownToRefresh();
								}, 1000);
							}
						},
						up: {							
							callback: function() {
								var self = this;
								getValue();
								setTimeout(function() {
									self.endPullUpToRefresh();
								}, 1000);
							}
						}
					});
				});
			});
		})(mui);

		function loadNews() {
			appElement = document.querySelector('[ng-controller=detailsController]');
			$scope = angular.element(appElement).scope();
			cur_page = 1;
			noMore = false;
			notes_res = [];
			goods_res = [];
			uid = plus.storage.getItem('uid');
			$scope.initView(uid);
			$scope.$apply();
		}

		function getValue() {
			appElement = document.querySelector('[ng-controller=detailsController]');
			$scope = angular.element(appElement).scope();
			uid = plus.storage.getItem('uid');
			$scope.initView(uid);
			$scope.$apply();
		}
	</script>

</html>